import request from '@/utils/request'

export function getRoutes() {
  return request({
    url: '/menu/GetMenus',
    method: 'get'
  })
}

export function getRoles(roleViewModel) {
  return request({
    url: '/role/GetRoleList',
    method: 'post',
    data: roleViewModel
  })
}

export function addRole(data) {
  return request({
    url: '/role/AddRole',
    method: 'post',
    data
  })
}

export function updateRole(data) {

  return request({
    url: `/role/UpdateRole`,
    method: 'post',
    data
  })
}

export function deleteRole(id) {
  return request({
    url: `/role/deleteRole?id=` + id,
    method: 'post'
  })
}
